const initVal = { user: {}, profile: {} }
const profile = (preState = initVal, action) => {
  const { type, payload } = action
  switch (type) {
    case 'profile/user':
      return {
        ...preState,
        user: payload
      }
    case 'profile/user/profile':
      return {
        ...preState,
        profile: payload
      }
    default:
      return preState
  }
}
export default profile
